﻿using Mes.Domain.BoundedContext.Entities.Quality;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Mes.Infrastructure.Data.BoundedContext.EntityTypeConfigurations.Quality
{
    public class SampleCharLinkToGoEntityConfig : IEntityTypeConfiguration<SampleCharLinkToGo>
    {
        public void Configure(EntityTypeBuilder<SampleCharLinkToGo> builder)
        {
            builder.ToTable("sample_char_link_to_go");
            builder.HasKey(e => new { e.Sample_Id,e.Char_Id });
            builder.Property(b => b.Sample_Id).IsRequired();
            builder.Property(b => b.Char_Id).IsRequired();
            builder.Property(b => b.Qm_Spec_Id);
            builder.Property(b => b.Last_Edit_Comment).HasMaxLength(254);
            builder.Property(b => b.Last_Edit_By).HasMaxLength(40).IsRequired();
            builder.Property(b => b.Last_Edit_At).IsRequired();
            builder.Property(b => b.Row_Id).IsRequired().UseIdentityColumn().HasIdentityOptions(startValue: 0, incrementBy: 1, minValue: 0);
        }
    }
}
